package com.tjetc.controller;

import com.tjetc.entity.Result;
import com.tjetc.service.UserFeignService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class UserConsumerFeignController {

    @Resource
    private UserFeignService userFeignService;

    @GetMapping("/user/consumer/openfeign/get/{id}")
    public Result getUserById(@PathVariable("id") int id) {
        // 根据id查询用户信息 调用这个接口就会给我返回一个result（接口文档中有详细说明）
        return userFeignService.getUserById(id);
    }
}
